from __future__ import annotations

from dataclasses import dataclass
from math import tan, radians


@dataclass
class MarkingResult:
    horizontal_offset_m: float
    vertical_offset_m: float
    note: str


def calculate_marking_amount(span_m: float, sight_angle_deg: float, tower_head_offset_m: float = 0.0) -> MarkingResult:
    """划印量（简化）：按平视/斜视投影近似。

    - 斜视角 α 时，水平划印 ≈ l·tanα
    - 可附加塔头偏位修正
    """

    alpha = radians(sight_angle_deg)
    h = span_m * tan(alpha)
    v = h * 0.0
    return MarkingResult(horizontal_offset_m=h + tower_head_offset_m, vertical_offset_m=v, note="平视α=0，斜视按tanα")


